Learn R Programming

NMF (version 0.5.06)

Comparing the results of different NMF runs: Comparing Results from Different NMF Runs

Description

This functions allow to compare the results of different NMF runs. The results do not need to be from the same algorithm, nor even of the same dimension.

Usage

## S3 method for class 'ANY':
as.NMFList(..., unlist=FALSE)

## S3 method for class 'list': compare(object, ..., unlist=FALSE)

## S3 method for class 'NMFList': plot(x, ...)

## S3 method for class 'NMFList': summary(object, sort.by=NULL, select=NULL, ...)

Arguments

object
A list or an object of class NMFList.
select
the columns to be output in the result data.frame. The column are given by their names (partially matched). The column names are the names of the summary measures returned by the summary methods of the corresponding NMF resu
sort.by
the sorting criteria, i.e. a partial match of a column name, by which the result data.frame is sorted. The sorting direction (increasing or decreasing) is computed internally depending on the chosen criteria (e.g. decreasing for the cop
unlist
boolean to specify if the arguments should be unlisted before wrapping them into a NMFList object or comparing them.
x
An object of class NMFList.
...
Used to pass extra arguments to subsequent calls:
  • inas.NMFListthe list of NMF results to wrap into aNMFListobject.
  • inplot: graphical parameters passed to theplotfunction.
  • in

Details

[object Object],[object Object],.,[object Object],[object Object],[object Object]

References

Metagenes and molecular pattern discovery using matrix factorization Brunet, J.~P., Tamayo, P., Golub, T.~R., and Mesirov, J.~P. (2004) Proc Natl Acad Sci U S A 101(12), 4164--4169.

Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis Kim, H. & Park, H. (2007) Bioinformatics. http://dx.doi.org/10.1093/bioinformatics/btm134.

See Also

NMFfitX1, NMFfitXn, summary

Examples

Run this code
# generate a synthetic dataset with known classes: 50 features, 18 samples (5+5+8)
n <- 50; counts <- c(5, 5, 8);
V <- syntheticNMF(n, counts, noise=TRUE)
metaHeatmap(V)

# build the class factor
groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))

# perform multiple runs of NMF (keep best only)
res <- nmf(V, 3, nrun=5)
res

# compute summary measures
summary(res)

# compute more summary measures
summary(res, target=V, class=groups)

# plot a heatmap of the consensus matrix with extra annotations
metaHeatmap(res, class=groups)

# retrieve the predicted clusters of samples
predict(res)

# perform multiple runs of NMF and keep all the runs
res <- nmf(V, 3, nrun=5, .options='k')
res

# extract best fit
fit(res)

# compute/show computational times
runtime.all(res)
seqtime(res)

Run the code above in your browser using DataLab